// @Author miaoqing
// @Date 2024/03/28 15:24:00
// @Desc
package logic

import (
	"core/command"
	"core/component/logger"
)

func (mgr *RoomManager) createRoomHandler(msgID uint16, data []byte) {
	msgRecv := &command.CSCrateRoom{}
	err := mgr.router.UnMarshal(data, msgRecv)
	if err != nil {
		logger.Errorf("recv data:%v msg:%v", data, msgRecv)
		return
	}
	//mgr.createRoom()
}

func (mgr *RoomManager) roomSrvPacketHandler(msgID uint16, data []byte) {
	msgRecv := &command.CSRoomSrvPacket{}
	err := mgr.router.UnMarshal(data, msgRecv)
	if err != nil {
		logger.Errorf("recv data:%v msg:%v", data, msgRecv)
		return
	}
	rm := mgr.getRoom(msgRecv.RoomID)
	if rm == nil {
		return
	}
	rm.msgQ <- msgRecv.Data
}
